$(function () {
    obj.init();
});

var obj = new function () {
    return {
        dataGrid: null,
        form: null,
        device: null,
        init: function () {
            this.device = xhTool.getQuery('device');
            this.dataGrid = new xhDataGrid($('#list'), 'Device/getRegisterHistory', {device: this.device});
            this.dataGrid.parseToolbar().init().activeButton([], []);
            this.funObj().bindDataGridEvent();
            this.form = new xhForm($('#xh_form'));
            this.listener();
        },
        listener: function () {
            var $this = this;
        },
        funObj: function () {
            var $this = this;
            return {
                bindDataGridEvent: function () {
                    $this.dataGrid.onLoadSuccess = function (data) {
                        if (xhExtra.checkError(data)) return false;
                        if (data.rows.length <= 0) return false;
                        $this.dataGrid.mergeCells(['sDevNumber', 'sMacAddress', 'sReceiverName']);
                    };
                }
            }
        }
    }
};
